﻿using lazada.Models;
using System;
using System.Collections.Generic;
using System.Data.SqlClient;
using System.Linq;
using System.Web;

namespace lazada.DAL
{
    public class FloorDAL:ConnectionDB
    {
        public FloorDAL(): base()
        {

        }

        public List<FloorModel> Floor(string id)
        {
            List<FloorModel> list = new List<FloorModel>();
            SqlCommand command = new SqlCommand();
            command.CommandText = "select * from TANG";
            command.Connection = Connection;
            SqlDataReader dr;
            dr = command.ExecuteReader();
            while(dr.Read())
            {
                FloorModel floor = new FloorModel();

                floor.MATANG = dr["MATANG"].ToString();
                floor.TENTANG = dr["TENTANG"].ToString();
                floor.LIST1 = dr["LIST1"].ToString();
                floor.LIST2 = dr["LIST2"].ToString();
                floor.LIST3 = dr["LIST3"].ToString();
                floor.LIST4 = dr["LIST4"].ToString();
                floor.LIST5 = dr["LIST5"].ToString();
                floor.LIST6 = dr["LIST6"].ToString();
                floor.LIST7 = dr["LIST7"].ToString();
                floor.LIST8 = dr["LIST8"].ToString();
                floor.LIST9 = dr["LIST9"].ToString();
                floor.LIST10 = dr["LIST10"].ToString();
                floor.LIST11 = dr["LIST11"].ToString();
                floor.LISTIMG1 = dr["LISTIMG1"].ToString();
                floor.LISTIMG2 = dr["LISTIMG2"].ToString();
                floor.LISTIMG3 = dr["LISTIMG3"].ToString();
                floor.LISTIMG4 = dr["LISTIMG4"].ToString();
                floor.LISTIMG5 = dr["LISTIMG5"].ToString();
                floor.LISTIMG6 = dr["LISTIMG6"].ToString();
                floor.LISTIMG7 = dr["LISTIMG7"].ToString();
                floor.LISTIMG8 = dr["LISTIMG8"].ToString();
                floor.LISTIMG9 = dr["LISTIMG9"].ToString();
                floor.LISTIMG10 = dr["LISTIMG10"].ToString();
                floor.LISTIMG11 = dr["LISTIMG11"].ToString();
                floor.LISTIMG12 = dr["LISTIMG12"].ToString();
                floor.LISTIMG13 = dr["LISTIMG13"].ToString();
                floor.LISTIMG14 = dr["LISTIMG14"].ToString();
                floor.LISTIMG15 = dr["LISTIMG15"].ToString();
                list.Add(floor);
            }
            Connection.Close();
            return list;
        }
    }
}